<?
	$sql = $mysqlclass->mysql_my_query("
		CREATE TABLE IF NOT EXISTS `".$setupdata['table_prefix']."object_data` (
		  `id` int(11) NOT NULL auto_increment,
		  `parent` int(11) NOT NULL default '0',
		  `name` tinytext NOT NULL,
		  `value` longtext NOT NULL,
		  `type` tinytext NOT NULL,
		  `pos` int(11) NOT NULL default '0',
		  `group` varchar(255) NOT NULL default '',
		  UNIQUE KEY `id` (`id`)
		) ENGINE=MyISAM AUTO_INCREMENT=1
	", __LINE__, __FILE__);
	
	$sql = $mysqlclass->mysql_my_query("SELECT `id` FROM `".$setupdata['table_prefix']."data` WHERE `type`='form'", __LINE__, __FILE__);
	while ($row = mysql_fetch_array($sql, MYSQL_ASSOC)){	
		$sql2 = $mysqlclass->mysql_my_query("SELECT * FROM `".$setupdata['table_prefix']."data` WHERE `parent`=".$row['id'], __LINE__, __FILE__);
		while ($row2 = mysql_fetch_array($sql2, MYSQL_ASSOC)){
			$row2['value'] = addslashes($row2['value']);
			$mysqlclass->mysql_my_query("INSERT INTO `".$setupdata['table_prefix']."object_data` (`id`, `parent`, `name`, `value`, `type`, `pos`, `group`) VALUES ('', '".$row2['parent']."', '".$row2['name']."', '".$row2['value']."', '".$row2['type']."', ".$row2['pos'].", 'form')", __LINE__, __FILE__);
			$mysqlclass->mysql_my_query("DELETE FROM `".$setupdata['table_prefix']."data` WHERE `id` = ".$row2['id'], __LINE__, __FILE__);		
		}
	}

	$sql = $mysqlclass->mysql_my_query("SELECT `id` FROM `".$setupdata['table_prefix']."data` WHERE `type`='vote'", __LINE__, __FILE__);
	while ($row = mysql_fetch_array($sql, MYSQL_ASSOC)){	
		$sql2 = $mysqlclass->mysql_my_query("SELECT * FROM `".$setupdata['table_prefix']."data` WHERE `parent`=".$row['id'], __LINE__, __FILE__);
		while ($row2 = mysql_fetch_array($sql2, MYSQL_ASSOC)){
			$row2['value'] = addslashes($row2['value']);
			$mysqlclass->mysql_my_query("INSERT INTO `".$setupdata['table_prefix']."object_data` (`id`, `parent`, `name`, `value`, `type`, `pos`, `group`) VALUES ('', '".$row2['parent']."', '".$row2['name']."', '".$row2['value']."', '".$row2['type']."', ".$row2['pos'].", 'vote')", __LINE__, __FILE__);
			$mysqlclass->mysql_my_query("DELETE FROM `".$setupdata['table_prefix']."data` WHERE `id` = ".$row2['id'], __LINE__, __FILE__);		
		}
	}

?>